package com.cius.model.product;

import com.cius.model.Sex;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by CiusCheung on 16/9/17.
 */
@Entity
@Table(name = "tb_productinfo")
public class ProductInfo implements Serializable {
    private Integer id;//商品编号
    private String name;//商品名称
    private String description;//商品说明
    private Date createTime = new Date();//上架时间
    private Float basePrice;//采购价格
    private Float marketPrice;//现在市场价格
    private Float sellPrice;//商品销售价格
    private Sex sexRequest;//所属性别
    private Boolean commend = false;//是否推荐商品(默认false)
    private Integer clickCount = 1 ;//访问量(统计受欢迎程度)
    private Integer sellCount= 0;//销售数量
    @ManyToOne(cascade = {},fetch = FetchType.LAZY)
    @JoinColumns({
            @JoinColumn(name = "categoryId")
    })
    private ProductCategory category;//所属类别
    @ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER)
    private UploadFile uploadFile;//上传文件

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Float getBasePrice() {
        return basePrice;
    }

    public void setBasePrice(Float basePrice) {
        this.basePrice = basePrice;
    }

    public Float getMarketPrice() {
        return marketPrice;
    }

    public void setMarketPrice(Float marketPrice) {
        this.marketPrice = marketPrice;
    }

    public Float getSellPrice() {
        return sellPrice;
    }

    public void setSellPrice(Float sellPrice) {
        this.sellPrice = sellPrice;
    }

    public Sex getSexRequest() {
        return sexRequest;
    }

    public void setSexRequest(Sex sexRequest) {
        this.sexRequest = sexRequest;
    }

    public Boolean getCommend() {
        return commend;
    }

    public void setCommend(Boolean commend) {
        this.commend = commend;
    }

    public Integer getClickCount() {
        return clickCount;
    }

    public void setClickCount(Integer clickCount) {
        this.clickCount = clickCount;
    }

    public Integer getSellCount() {
        return sellCount;
    }

    public void setSellCount(Integer sellCount) {
        this.sellCount = sellCount;
    }

    public ProductCategory getCategory() {
        return category;
    }

    public void setCategory(ProductCategory category) {
        this.category = category;
    }

    public UploadFile getUploadFile() {
        return uploadFile;
    }

    public void setUploadFile(UploadFile uploadFile) {
        this.uploadFile = uploadFile;
    }
}
